//package com.fbb.tool;
//
//import java.util.List;
//
//import net.htmlparser.jericho.Element;
//import net.htmlparser.jericho.Source;
//
//public class HtmlParse {
//	
//	public static void extract(String inputHtml){
//		Source source = new Source(inputHtml);
//		Element form  = source.getElementById("J_FrmBid");
//		List<Element> inputArea = form.getAllElements("input");
//		String price ="";
//		String area ="";
//		String transportInfo="";
//		
//		for(Element input : inputArea){	
//			if(input.getAttributeValue("name").equals("buy_now"))price = input.getAttributeValue("value");
//			if(input.getAttributeValue("name").equals("region"))area =  input.getAttributeValue("value");
//			if(input.getAttributeValue("name").equals("who_pay_ship"))transportInfo =  input.getAttributeValue("value");
//			
//		}
//		Element others  = source.getAllElementsByClass("other clearfix").get(0);
//		String otherInfo = others.getContent().getTextExtractor().toString().trim();
//		int startBabyType =otherInfo.indexOf("宝贝类型：");
//		int endBabyType=  otherInfo.indexOf("收藏人气：");
//		String babyType = otherInfo.substring(startBabyType+5,endBabyType);
//		int endStore = otherInfo.indexOf("类似收藏");
//		String storeCount = otherInfo.substring(endBabyType+5,endStore-1).trim();
//		ShoppingDetail detail = new ShoppingDetail();
//		detail.setArea(area);
//		detail.setBabyType(babyType);
//		detail.setPrice(price);
//		detail.setStroreCount(Integer.parseInt(storeCount));
//		detail.setTransportInfo(transportInfo);
//		return detail;
//	}
//	
//	public static void main(String[] args) throws Exception {
//		String content = HttpClientUtils.getContent("http://item.taobao.com/item.htm?id=3144581940", "UTF-8");
//		ShoppingDetail detail = HtmlParseTest.extract(content);
//		System.out.println(detail);
//	}
//}
